package com.hotel.app.controller;


import com.hotel.app.service.VipServiceFeign;
import com.hotel.common.config.SystemConfig;
import com.hotel.common.param.UserVipAdd;
import com.hotel.common.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * --- 年薪百万 ---
 * ---So easy---
 *
 * @author ZhiHuiJun
 * @motto 学习都是人上人
 * @desc 就是很帅很优秀
 * @CC 每天漂亮、幸福、快乐、自由
 */
@RestController
@RequestMapping("/api/user/vip")
public class VipController {
    @Autowired
    private VipServiceFeign vipServiceFeign;

    @PostMapping("/save")
    public R save(@RequestBody UserVipAdd userVipAdd) {
        return vipServiceFeign.save(userVipAdd);
    }

    @GetMapping("/my")
    public R my(HttpServletRequest request){
        String token = request.getHeader(SystemConfig.HEADER_TOKEN);
        return vipServiceFeign.my();
    }
}
